<%--
  Created by IntelliJ IDEA.
  User: dusy
  Date: 2017/11/23
  Time: 8:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <jsp:include page="../../head.jsp"/>
    <title>业务操作量统计查询</title>
    <script type="text/javascript">
        var formSetting = {
            title: "业务操作量统计查询",
            module: 'query',
            numCount: '2',
            columns: [
                {
                    name: "DECLARATION_TYPE",
                    label: "业务类型",
                    type: "dropdown",
                    data: [["进口", "E"], ["出口", "I"], ["全部", "a"]],
                    op: "ne",
                    minLength: 0
                }, {
                    name: "SUP_ID",
                    label: "报关行",
                    type: "dropdown",
                    dropdownType: "ajax",
                    url: "../../order-dropdown/supCompany",
                    op: "eq",
                    minLength: 0,
                    keyWordName: "key",
                    success: function (data) {
                        data = data.results;
                        var array = new Array();
                        $.each(data, function (i, n) {
                            array.push([n["name"], n["value"]]);
                        });
                        return array;
                    },
                }, {
                    name: "CREATE_TIME",
                    label: "受理时间从",
                    type: "date",
                    op: "ge"
                }, {
                    name: "CREATE_TIME",
                    label: "受理时间到",
                    type: "date",
                    op: "le"
                }
            ],
            buttons: {
                custom: [
                    {
                        id: "exportOperationalEfficiencyExcl",
                        value: "导出业务操作量统计记录",
                        click: function () {
                            var whereCase = assembleWhereCase(formSetting.columns);
                            var declarationType = $(
                                "input[name = '" + formSetting.columns[0].name + "']")[0].value;
                            if (!whereCase) {
                                jw.alert("查询条件不能全空");
                                return;
                            } else {
                                whereCase = " where 1=1" + whereCase;
                                jQuery(
                                    '<form action="downloadOperationStatistics" method="post" style="display: none">'
                                    + '<input name="whereCase" value="' + whereCase + '"/>' +
                                    '<input name="declarationType" value="' + declarationType
                                    + '"/></form>')
                                    .appendTo('body').submit().remove();
                            }
                        }
                    }
                ]
            },
            grid: {
                id: "gridTable",
                title: "查询结果",
                url: "getOperationStatistics",
                dataType: "application/json",
                colModel: [{
                    sortable: false,
                    index: "DECLARATION_TYPE",
                    name: "declarationType",
                    label: "业务类型"
                }, {
                    index: "supCom.COM_NAME",
                    name: "customsBroker",
                    label: "报关行"
                }, {
                    index: "U_NAME",
                    name: "acceptor",
                    label: "用户名"
                }, {
                    index: "ACCEPT_QUANTITY",
                    name: "acceptQuantity",
                    label: "受理单证数量"
                }]
            }

        };
        $(document).ready(function () {
            $("#dataTable").mrdForm(formSetting);
        });
    </script>
</head>
<body>
<div id="dataTable"></div>
</body>
</html>

